#include <stdio.h>
#include <string.h>

void initHome(){
	system("clear");
	printf("/*************************************************************************/\n");
	printf("/****************                                        *****************/\n");
	printf("/**************** welcome to the customer service system *****************/\n");
	printf("/****************                                        *****************/\n");
	printf("/****************       entry 1 to Login your acount     *****************/\n");
	printf("/****************                                        *****************/\n");
	printf("/****************       entry 2 to Register your acount  *****************/\n");
	printf("/****************                                        *****************/\n");
	printf("/****************       entry 3 to exit                  *****************/\n");
	printf("/****************                                        *****************/\n");
	printf("/*************************************************************************/\n\n");
}


void initEnterPage(char *identity, char *acount, char *name){
	system("clear");
	printf("/*************************************************************************/\n");
	printf("/****************                                        *****************/\n");
	printf("/****************      	Login     success                *****************/\n");
	printf("/****************                                        *****************/\n");
	printf("/****************	identity:    %s              *******************/\n",identity);
	printf("/****************	acount  :    %s              *******************/\n",acount);
	printf("/****************	name    :    %s              *******************/\n",name);
	printf("/****************                                        *****************/\n");
	printf("/*************************************************************************/\n");
	
}

void initLogin(int *flag, char *identity,char *acount, char *password){
			printf("\nentry your identity ( ||manager is 0 || servce is 1 || custom is 2||):");
			scanf("%d", flag);
			while (*flag < 0 || *flag > 2){
				printf("identity error\n");
				printf("entry your identity ( ||manager is 0 || servce is 1 || custom is 2||):");      //entry identity
				scanf("%d", flag);
			}
			printf("\nentry your acount:");									//entry acount
			scanf("%s", acount);
			printf("\nentry your password:");								//entry password
			scanf("%s", password);

			if (*flag == 0){
				strcpy(identity, "manager");
			} else if (*flag == 1) {
				strcpy(identity, "service");
			} else {
				strcpy(identity, "custom");
			}
}

void initRegister(int *flag, char *identity,char *name, char *password){
			printf("entry your identity ( ||manager is 0 || servce is 1 || custom is 2||):");
			scanf("%d", flag);
			while (*flag < 0 || *flag > 2){
				printf("identity error\n");
				printf("entry your identity ( ||manager is 0 || servce is 1 || custom is 2||):");      //entry identity
				scanf("%d", flag);
			}
			printf("\nentry your name:");									//entry acount
			scanf("%s", name);
			printf("\nentry your password:");								//entry password
			scanf("%s", password);

			if (*flag == 0){
				strcpy(identity, "manager");
			} else if (*flag == 1) {
				strcpy(identity, "service");
			} else {
				strcpy(identity, "custom");
			}

}

void initCmd(char *identity){

	if (strcmp(identity, "manager") == 0){

		printf("/*****************      your function                   	      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/****************      	1. update a service information               *****************/\n");
		printf("/****************      	2. get assr Book                	      *****************/\n");
		printf("/****************      	3. get help				      *****************/\n");
		printf("/****************      	4. exit				              *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/****************       entry number                        	      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/**************************************************************************************/\n\n");

	} else if (strcmp(identity, "service") == 0){

		printf("/*****************      your function                   	      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/****************      	1. update a custom information                *****************/\n");
		printf("/****************      	2. back a message                	      *****************/\n");
		printf("/****************      	3. send message				      *****************/\n");
		printf("/****************      	4. search chat record			      *****************/\n");
		printf("/****************       5. get assr Book                      	      *****************/\n");
		printf("/****************       6. get help                 		      *****************/\n");
		printf("/****************       7. exit                  		      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/****************       entry number                        	      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/**************************************************************************************/\n\n");
	} else if (strcmp(identity, "custom") == 0){

		printf("/*****************      your function                   	      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/****************      	1. send message				      *****************/\n");
		printf("/****************      	2. search chat record			      *****************/\n");
		printf("/****************      	3. back a message                	      *****************/\n");
		printf("/****************       4. get assr Book                      	      *****************/\n");
		printf("/****************       5. get service / change a service             *****************/\n");
		printf("/****************       6. get help                 		      *****************/\n");
		printf("/****************       7. exit                 		      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/****************       entry number                        	      *****************/\n");
		printf("/****************                               		      *****************/\n");
		printf("/**************************************************************************************/\n\n");
	}
}


